package ltd.hxya.novel.admin.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import ltd.hxya.novel.admin.entity.UserOperation;
import ltd.hxya.novel.admin.mapper.UserOperationMapper;
import ltd.hxya.novel.admin.service.IUserOperationService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserOperationServiceImpl extends ServiceImpl<UserOperationMapper, UserOperation> implements IUserOperationService {

    /**
     * 根据对应的idList，删除对应的数据
     * @param idList
     */
    @Override
    public void deleteByIds(List<Integer> idList) {
        if (idList ==null){
            return;
        }
        QueryWrapper<UserOperation> queryWrapper = new QueryWrapper<>();
        for (Integer integer : idList) {
            queryWrapper.eq("user_id",integer);
            this.baseMapper.delete(queryWrapper);
        }
    }

}
